@echo off
echo 📱 切换到真机RedPlayer模式...

REM 恢复原始配置
if exist "entry\oh-package.json5.backup" (
    copy "entry\oh-package.json5.backup" "entry\oh-package.json5"
    echo ✅ 已恢复RedPlayer依赖配置
) else (
    echo ⚠️ 未找到备份配置，手动添加RedPlayer依赖...
    echo {> "entry\oh-package.json5"
    echo   "name": "entry",>> "entry\oh-package.json5"
    echo   "version": "1.0.0",>> "entry\oh-package.json5"
    echo   "description": "Please describe the basic information.",>> "entry\oh-package.json5"
    echo   "main": "",>> "entry\oh-package.json5"
    echo   "author": "",>> "entry\oh-package.json5"
    echo   "license": "",>> "entry\oh-package.json5"
    echo   "dependencies": {>> "entry\oh-package.json5"
    echo     "@rte-xhs/redplayer": "^1.0.0">> "entry\oh-package.json5"
    echo   }>> "entry\oh-package.json5"
    echo }>> "entry\oh-package.json5"
)

REM 清理依赖缓存
if exist "oh_modules" rmdir /s /q "oh_modules"
if exist "entry\oh_modules" rmdir /s /q "entry\oh_modules"

echo ✅ RedPlayer模式已激活
echo 💡 现在可以在真机上体验完整RedPlayer功能
echo 🔄 要切换到模拟器模式，请运行 switch-to-emulator.bat
pause